/* NOTICE
 
    Jim - the Java Image Manager, copyright (c) 2005 - 2007 Grant Gardner 
 
    Jim is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Jim is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
    In addition, as a special exception, you are permitted to link this code
    with the 3rd party libraries required to compile this file and to
    distribute a linked combination including them. You must obey the
    GNU General Public License in all respects for all of the code except for
    those 3rd party libraries that are licenced under terms incompatible with the
    GNU General Public License.  
 
 
 NOTICE */

/*
 * Created by dnoakes on 26-Nov-2002 11:00:52 using IntelliJ IDEA.
 */

package au.com.lastweekend.jim.io.exif;

import java.util.HashMap;
import java.util.Map;

import au.com.lastweekend.jim.io.metadata.Directory;

/**
 * 
 * 
 * 
 * @version $Id: GPSDirectory.java,v 1.3 2006/02/20 12:21:10 ggardner Exp $
 * @author <a href="mailto:grant@lastweekend.com.au"> <Grant Gardner> </a>
 */
public class GPSDirectory extends Directory {

    /** GPS tag version GPSVersionID 0 0 BYTE 4 */
    public static final int TAG_GPS_VERSION_ID = 0x0000;
    /** North or South Latitude GPSLatitudeRef 1 1 ASCII 2 */
    public static final int TAG_GPS_LATITUDE_REF = 0x0001;
    /** Latitude GPSLatitude 2 2 RATIONAL 3 */
    public static final int TAG_GPS_LATITUDE = 0x0002;
    /** East or West Longitude GPSLongitudeRef 3 3 ASCII 2 */
    public static final int TAG_GPS_LONGITUDE_REF = 0x0003;
    /** Longitude GPSLongitude 4 4 RATIONAL 3 */
    public static final int TAG_GPS_LONGITUDE = 0x0004;
    /** Altitude reference GPSAltitudeRef 5 5 BYTE 1 */
    public static final int TAG_GPS_ALTITUDE_REF = 0x0005;
    /** Altitude GPSAltitude 6 6 RATIONAL 1 */
    public static final int TAG_GPS_ALTITUDE = 0x0006;
    /** GPS time (atomic clock) GPSTimeStamp 7 7 RATIONAL 3 */
    public static final int TAG_GPS_TIME_STAMP = 0x0007;
    /** GPS satellites used for measurement GPSSatellites 8 8 ASCII Any */
    public static final int TAG_GPS_SATELLITES = 0x0008;
    /** GPS receiver status GPSStatus 9 9 ASCII 2 */
    public static final int TAG_GPS_STATUS = 0x0009;
    /** GPS measurement mode GPSMeasureMode 10 A ASCII 2 */
    public static final int TAG_GPS_MEASURE_MODE = 0x000A;
    /** Measurement precision GPSDOP 11 B RATIONAL 1 */
    public static final int TAG_GPS_DOP = 0x000B;
    /** Speed unit GPSSpeedRef 12 C ASCII 2 */
    public static final int TAG_GPS_SPEED_REF = 0x000C;
    /** Speed of GPS receiver GPSSpeed 13 D RATIONAL 1 */
    public static final int TAG_GPS_SPEED = 0x000D;
    /** Reference for direction of movement GPSTrackRef 14 E ASCII 2 */
    public static final int TAG_GPS_TRACK_REF = 0x000E;
    /** Direction of movement GPSTrack 15 F RATIONAL 1 */
    public static final int TAG_GPS_TRACK = 0x000F;
    /** Reference for direction of image GPSImgDirectionRef 16 10 ASCII 2 */
    public static final int TAG_GPS_IMG_DIRECTION_REF = 0x0010;
    /** Direction of image GPSImgDirection 17 11 RATIONAL 1 */
    public static final int TAG_GPS_IMG_DIRECTION = 0x0011;
    /** Geodetic survey data used GPSMapDatum 18 12 ASCII Any */
    public static final int TAG_GPS_MAP_DATUM = 0x0012;
    /** Reference for latitude of destination GPSDestLatitudeRef 19 13 ASCII 2 */
    public static final int TAG_GPS_DEST_LATITUDE_REF = 0x0013;
    /** Latitude of destination GPSDestLatitude 20 14 RATIONAL 3 */
    public static final int TAG_GPS_DEST_LATITUDE = 0x0014;
    /** Reference for longitude of destination GPSDestLongitudeRef 21 15 ASCII 2 */
    public static final int TAG_GPS_DEST_LONGITUDE_REF = 0x0015;
    /** Longitude of destination GPSDestLongitude 22 16 RATIONAL 3 */
    public static final int TAG_GPS_DEST_LONGITUDE = 0x0016;
    /** Reference for bearing of destination GPSDestBearingRef 23 17 ASCII 2 */
    public static final int TAG_GPS_DEST_BEARING_REF = 0x0017;
    /** Bearing of destination GPSDestBearing 24 18 RATIONAL 1 */
    public static final int TAG_GPS_DEST_BEARING = 0x0018;
    /** Reference for distance to destination GPSDestDistanceRef 25 19 ASCII 2 */
    public static final int TAG_GPS_DEST_DISTANCE_REF = 0x0019;
    /** Distance to destination GPSDestDistance 26 1A RATIONAL 1 */
    public static final int TAG_GPS_DEST_DISTANCE = 0x001A;

    protected static final HashMap<Integer, String> TAG_NAME_MAP = new HashMap<Integer, String>();

    static {
        TAG_NAME_MAP.put(TAG_GPS_VERSION_ID, "GPS Version ID");
        TAG_NAME_MAP.put(TAG_GPS_LATITUDE_REF, "GPS Latitude Ref");
        TAG_NAME_MAP.put(TAG_GPS_LATITUDE, "GPS Latitude");
        TAG_NAME_MAP.put(TAG_GPS_LONGITUDE_REF, "GPS Longitude Ref");
        TAG_NAME_MAP.put(TAG_GPS_LONGITUDE, "GPS Longitude");
        TAG_NAME_MAP.put(TAG_GPS_ALTITUDE_REF, "GPS Altitude Ref");
        TAG_NAME_MAP.put(TAG_GPS_ALTITUDE, "GPS Altitude");
        TAG_NAME_MAP.put(TAG_GPS_TIME_STAMP, "GPS Time-Stamp");
        TAG_NAME_MAP.put(TAG_GPS_SATELLITES, "GPS Satellites");
        TAG_NAME_MAP.put(TAG_GPS_STATUS, "GPS Status");
        TAG_NAME_MAP.put(TAG_GPS_MEASURE_MODE, "GPS Measure Mode");
        TAG_NAME_MAP.put(TAG_GPS_DOP, "GPS DOP");
        TAG_NAME_MAP.put(TAG_GPS_SPEED_REF, "GPS Speed Ref");
        TAG_NAME_MAP.put(TAG_GPS_SPEED, "GPS Speed");
        TAG_NAME_MAP.put(TAG_GPS_TRACK_REF, "GPS Track Ref");
        TAG_NAME_MAP.put(TAG_GPS_TRACK, "GPS Track");
        TAG_NAME_MAP.put(TAG_GPS_IMG_DIRECTION_REF, "GPS Img Direction Ref");
        TAG_NAME_MAP.put(TAG_GPS_IMG_DIRECTION_REF, "GPS Img Direction");
        TAG_NAME_MAP.put(TAG_GPS_MAP_DATUM, "GPS Map Datum");
        TAG_NAME_MAP.put(TAG_GPS_DEST_LATITUDE_REF, "GPS Dest Latitude Ref");
        TAG_NAME_MAP.put(TAG_GPS_DEST_LATITUDE, "GPS Dest Latitude");
        TAG_NAME_MAP.put(TAG_GPS_DEST_LONGITUDE_REF, "GPS Dest Longitude Ref");
        TAG_NAME_MAP.put(TAG_GPS_DEST_LONGITUDE, "GPS Dest Longitude");
        TAG_NAME_MAP.put(TAG_GPS_DEST_BEARING_REF, "GPS Dest Bearing Ref");
        TAG_NAME_MAP.put(TAG_GPS_DEST_BEARING, "GPS Dest Bearing");
        TAG_NAME_MAP.put(TAG_GPS_DEST_DISTANCE_REF, "GPS Dest Distance Ref");
        TAG_NAME_MAP.put(TAG_GPS_DEST_DISTANCE, "GPS Dest Distance");
    }

    public GPSDirectory(Directory parent) {

        super(parent);
        this.setDescriptor(new GPSDescriptor(this));
    }

    @Override
    public String getName() {

        return "GPS";
    }

    @Override
    protected Map<Integer, String> getTagNameMap() {

        return TAG_NAME_MAP;
    }
}